<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty plugin
 * 
 */
function smarty_modifier_dayintdiff($int, $day = 7){
	$result = date("Y-m-d", $int);
	$dayint = intval((time() - strtotime($result)) / (60 * 60 * 24));
	if($dayint <= $day){
		if($dayint > 0){
			$result = $dayint."天前";
		}else{
			$result = "今天";
		}
	}
    return $result;
}
?>
